<?php
/*
@version        2010-06-19 16:00
@package        DVDWeb
@license        GNU/GPL3, see LICENSE.php
@author         Gustavo, Rafael, Sandro
*/
include "../banco.inc.php";
include "verifica.php";

$usuario = $_COOKIE['usuario'];

?>
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Dvd WEB</title>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO8859-1">
    <link rel="stylesheet" type="text/css" href="css/style.css">
  </head>
  <body>

<table border=2>
<tr>
	<th>Filme</th><th>Valor</th>
</tr>

<?php

$idMeuFilme = mysql_query("SELECT usuario, id_filme FROM tb_locados WHERE usuario LIKE '$usuario'");
$dadosFilme = mysql_query("SELECT nome,sinopse,valor,locado FROM tb_filmes WHERE locado=1 LIKE '%$texto_busca%' ORDER by nome");

echo "<div align='center' style=\"background-color:gray;width:250;color:white;\"><font size='4.5pt'>Filmes locados por <b>".$usuario."</b> </div><br>";

while ($linha = mysql_fetch_array($idMeuFilme)) {
	$id_filme = $linha['id_filme'];

	$dadosFilme = mysql_query("SELECT nome,sinopse,valor,locado FROM tb_filmes WHERE locado=1 AND id LIKE '%$id_filme%' ORDER by nome");

	while ($linha2 = mysql_fetch_array($dadosFilme)) {
		echo "<tr><td>".$linha2['nome']."</td><td>R$ ".$linha2['valor']."</td></tr>";
		$total += $linha2['valor'];
	}
}
	echo "<tr><td>TOTAL</td><td>R$ ".$total."</td></tr>";
	echo "</table>";

?>
	<form method="post">
		<br><br>
		<p align="center">
			<input type="button" value=":: Fechar ::" onclick="window.close();">
		</p>
	</form>
  </body>
</html>
